<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  
  <link rel="shortcut icon" href="../../images/favicon.png">
  
  <title>Read, search, filter - Daptin</title>
  <link href='https://fonts.googleapis.com/css?family=Muli:400,700|Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
  <link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' rel='stylesheet' type='text/css'>

  <link rel="stylesheet" href="../../css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../css/theme_extra.css" type="text/css" />
  <link href="../../css/theme_extra.css" rel="stylesheet">
  
  <script>
    // Current page data
    var mkdocs_page_name = "Read, search, filter";
    var mkdocs_page_input_path = "apis/read.md";
    var mkdocs_page_url = null;
  </script>
  
  <script src="../../js/jquery-2.1.1.min.js" defer></script>
  <script src="../../js/modernizr-2.8.3.min.js" defer></script> 
  
  <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-114227400-1', 'docs.dapt.in');
      ga('send', 'pageview');
  </script>
  
</head>

<body class="wy-body-for-nav" role="document">

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
      <div class="wy-side-nav-search">
        <a href="../.." class="icon icon-home"> Daptin</a>
        <div role="search">
  <form id ="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" title="Type search term here" />
  </form>
</div>
      </div>

      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
	<ul class="tocbase current">
    
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">Daptin</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../..">Introduction</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../setting-up/installation/">Installation</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../setting-up/settingup/">Getting started</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../setting-up/access/">User management</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../setting-up/data_modeling/">Data model</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">API reference</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../overview/">Overview</a>
  </li>
        
          
  <li class="navtree toctree-l2 label">
    <p class="caption">CRUD</p>
  </li>


  

  
    <li class="navtree toctree-l2 group">
      <ul class="navtree subnav-l2 current">
          


  
    
    <li class="navtree toctree-l3 page current">
      <a class="current" href="./">
        Read, search, filter
      </a>
    </li>
    
      

  <li class="toctree-l3 current with-children">
    <a href="#get-apientityname">
      GET /api/&lt;entityName&gt;
      <span class="toctree-expand"></span>
    </a>
  </li>



  <li class="toctree-l3 current">
    <ul class="subnav-l3 current">
    
      
        <li class="toctree-l4">
          <a class="toctree-l5" href="#parameters">Parameters</a>
        </li>
    
    </ul>
  </li>

      

  <li class="toctree-l3">
    <a href="#response">
      Response
      <span class="toctree-expand"></span>
    </a>
  </li>



      

  <li class="toctree-l3">
    <a href="#examples">
      Examples
      <span class="toctree-expand"></span>
    </a>
  </li>



  <li class="toctree-l3">
    <ul class="subnav-l3 toc-hidden">
    
      
        <li class="toctree-l4">
          <a class="toctree-l5" href="#curl-example">Curl example</a>
        </li>
    
      
        <li class="toctree-l4">
          <a class="toctree-l5" href="#jquery-ajax-example">jQuery ajax example</a>
        </li>
    
      
        <li class="toctree-l4">
          <a class="toctree-l5" href="#node-js-example">Node js example</a>
        </li>
    
      
        <li class="toctree-l4">
          <a class="toctree-l5" href="#python-example">Python example</a>
        </li>
    
      
        <li class="toctree-l4">
          <a class="toctree-l5" href="#php-example">PHP example</a>
        </li>
    
    </ul>
  </li>

      

  <li class="toctree-l3">
    <a href="#filtering">
      Filtering
      <span class="toctree-expand"></span>
    </a>
  </li>



  <li class="toctree-l3">
    <ul class="subnav-l3 toc-hidden">
    
      
        <li class="toctree-l4">
          <a class="toctree-l5" href="#example">Example</a>
        </li>
    
    </ul>
  </li>


  
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../create/">Create</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../update/">Update</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../delete/">Delete</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../relation/">Relations</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../execute/">Execute</a>
  </li>
        
      </ul>
    </li>
        
          
  <li class="navtree toctree-l2 label">
    <p class="caption">Features</p>
  </li>


  

  
    <li class="navtree toctree-l2 group">
      <ul class="navtree subnav-l2 current">
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../features/enable-graphql/">GraphQL</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../features/enable-data-auditing/">Data Auditing</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../features/enable-multilingual-table/">Multilingual Table</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../features/enable-smtp-imap/">SMTP/IMPS server</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../features/enable-logs/">Logs</a>
  </li>
        
      </ul>
    </li>
        
          
  <li class="navtree toctree-l2 label">
    <p class="caption">Action APIs</p>
  </li>


  

  
    <li class="navtree toctree-l2 group">
      <ul class="navtree subnav-l2 current">
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../actions/actions/">Using actions</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../actions/default_actions/">Actions list</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../actions/examples/">Examples</a>
  </li>
        
      </ul>
    </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../state/machines/">State tracking</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">OAuth Management</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../extend/oauth_connection/">Connections</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../extend/oauth_token/">Tokens</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">Integrations</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../integrations/overview/">Overview</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">Asset and file storage</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../cloudstore/cloudstore/">Connecting with cloud store</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../cloudstore/assetcolumns/">Cloud store backed asset columns</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">Sub-sites</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../subsite/subsite/">Creating a subsite</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../subsite/grapes/">Live editing a subsite</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../subsite/basic_auth/">Basic Authentication</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">Sharing</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../extend/marketplace/">Marketplace</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">Reference</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../data-modeling/data_storage/">Data store format</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../extend/data_exchange/">Data exchange and sync</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../streams/streams/">Data streams</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../setting-up/enabling-features/">Enable/Disabling features</a>
  </li>
        
      </ul>
    </li>
    
  </ul>
      </div>
      &nbsp;
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="../..">Daptin</a>
      </nav>

      
      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="../..">Docs</a> &raquo;</li>
    
      
        
          <li>CRUD &raquo;</li>
        
      
        
          <li>API reference &raquo;</li>
        
      
    
    <li>Read, search, filter</li>
    <li class="wy-breadcrumbs-aside">
      
    </li>
  </ul>
  <hr/>
</div>
          <div role="main">
            <div class="section">
              
                <h1 id="get-apientityname">GET /api/&lt;entityName&gt;<a class="headerlink" href="#get-apientityname" title="Permanent link">Link</a></h1>
<h2 id="parameters">Parameters<a class="headerlink" href="#parameters" title="Permanent link">Link</a></h2>
<table>
<thead>
<tr>
<th>Name</th>
<th>parameter type</th>
<th>default value</th>
<th>example value</th>
</tr>
</thead>
<tbody>
<tr>
<td>page[number]</td>
<td>integer</td>
<td>1</td>
<td>5</td>
</tr>
<tr>
<td>page[size]</td>
<td>integer</td>
<td>10</td>
<td>100</td>
</tr>
<tr>
<td>query</td>
<td>json base64</td>
<td>[]</td>
<td>[{"column": "name", "operator": "is", "value": "england"}]</td>
</tr>
<tr>
<td>group</td>
<td>string</td>
<td>-</td>
<td>[{"column": "name", "order": "desc"}]</td>
</tr>
<tr>
<td>included_relations</td>
<td>comma separated string</td>
<td>-</td>
<td>user post author</td>
</tr>
<tr>
<td>sort</td>
<td>comma seaparated string</td>
<td>-</td>
<td>created_at amount guest_count</td>
</tr>
<tr>
<td>filter</td>
<td>string</td>
<td>-</td>
<td>england</td>
</tr>
</tbody>
</table>
<h1 id="response">Response<a class="headerlink" href="#response" title="Permanent link">Link</a></h1>
<div class="admonition note">
<p class="admonition-title">Response example</p>
<div class="codehilite"><pre><span></span>{
    &quot;links&quot;: {
        &quot;current_page&quot;: 1,
        &quot;from&quot;: 0,
        &quot;last_page&quot;: 1,
        &quot;per_page&quot;: 10,
        &quot;to&quot;: 10,
        &quot;total&quot;: 1
    },
    &quot;data&quot;: [{
        &quot;type&quot;: &quot;book&quot;,
        &quot;id&quot;: &quot;29d11cb3-3fad-4972-bf3b-9cfc6da9e6a6&quot;,
        &quot;attributes&quot;: {
            &quot;__type&quot;: &quot;book&quot;,
            &quot;confirmed&quot;: 0,
            &quot;created_at&quot;: &quot;2018-04-05 15:47:29&quot;,
            &quot;title&quot;: &quot;book title&quot;,
            &quot;name&quot;: &quot;book name&quot;,
            &quot;permission&quot;: 127127127,
            &quot;reference_id&quot;: &quot;29d11cb3-3fad-4972-bf3b-9cfc6da9e6a6&quot;,
            &quot;updated_at&quot;: null,
            &quot;user_id&quot;: &quot;696c98d3-3b8b-41da-a510-08e6948cf661&quot;
        },
        &quot;relationships&quot;: {
            &quot;author_id&quot;: {
                &quot;links&quot;: {
                    &quot;related&quot;: &quot;/api/book/&lt;book-id/author_id&quot;,
                    &quot;self&quot;: &quot;/api/book/&lt;book-id&gt;/relationships/author_id&quot;
                },
                &quot;data&quot;: []
            }
        }
    }]
}
</pre></div>

</div>
<h1 id="examples">Examples<a class="headerlink" href="#examples" title="Permanent link">Link</a></h1>
<h2 id="curl-example">Curl example<a class="headerlink" href="#curl-example" title="Permanent link">Link</a></h2>
<div class="codehilite"><pre><span></span>curl &#39;/api/&lt;entityName&gt;?sort=&amp;page[number]=1&amp;page[size]=10&#39; \
  -H &#39;Authorization: Bearer &lt;AccessToken&gt;&#39;
</pre></div>


<h2 id="jquery-ajax-example">jQuery ajax example<a class="headerlink" href="#jquery-ajax-example" title="Permanent link">Link</a></h2>
<div class="codehilite"><pre><span></span>$.ajax({
    method: &quot;GET&quot;,
    url: &#39;/api/&lt;entityName&gt;?sort=&amp;page[number]=1&amp;page[size]=10&#39;,
    success: function(response){
        console.log(response.data);
    }
  })
</pre></div>


<h2 id="node-js-example">Node js example<a class="headerlink" href="#node-js-example" title="Permanent link">Link</a></h2>
<div class="codehilite"><pre><span></span><span class="kd">var</span> <span class="nx">request</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;request&#39;</span><span class="p">);</span>

<span class="kd">var</span> <span class="nx">headers</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;Authorization&#39;</span><span class="o">:</span> <span class="s1">&#39;Bearer &lt;AccessToken&gt;&#39;</span>
<span class="p">};</span>

<span class="kd">var</span> <span class="nx">options</span> <span class="o">=</span> <span class="p">{</span>
    <span class="nx">url</span><span class="o">:</span> <span class="s1">&#39;/api/&lt;entityName&gt;?sort=&amp;page[number]=1&amp;page[size]=10&#39;</span><span class="p">,</span>
    <span class="nx">headers</span>: <span class="kt">headers</span>
<span class="p">};</span>

<span class="kd">function</span> <span class="nx">callback</span><span class="p">(</span><span class="nx">error</span><span class="p">,</span> <span class="nx">response</span><span class="p">,</span> <span class="nx">body</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">error</span> <span class="o">&amp;&amp;</span> <span class="nx">response</span><span class="p">.</span><span class="nx">statusCode</span> <span class="o">==</span> <span class="mi">200</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">body</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">}</span>

<span class="nx">request</span><span class="p">(</span><span class="nx">options</span><span class="p">,</span> <span class="nx">callback</span><span class="p">);</span>
</pre></div>


<h2 id="python-example">Python example<a class="headerlink" href="#python-example" title="Permanent link">Link</a></h2>
<div class="codehilite"><pre><span></span><span class="kn">import</span> <span class="nn">requests</span>

<span class="n">headers</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;Authorization&#39;</span><span class="p">:</span> <span class="s1">&#39;Bearer &lt;AccessToken&gt;&#39;</span><span class="p">,</span>
<span class="p">}</span>

<span class="n">params</span> <span class="o">=</span> <span class="p">(</span>
    <span class="p">(</span><span class="s1">&#39;sort&#39;</span><span class="p">,</span> <span class="s1">&#39;-created_at&#39;</span><span class="p">),</span>
    <span class="p">(</span><span class="s1">&#39;page[number]&#39;</span><span class="p">,</span> <span class="s1">&#39;1&#39;</span><span class="p">),</span>
    <span class="p">(</span><span class="s1">&#39;page[size]&#39;</span><span class="p">,</span> <span class="s1">&#39;10&#39;</span><span class="p">),</span>
<span class="p">)</span>

<span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;http://localhost:6336/api/laptop&#39;</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">)</span>
</pre></div>


<h2 id="php-example">PHP example<a class="headerlink" href="#php-example" title="Permanent link">Link</a></h2>
<div class="codehilite"><pre><span></span><span class="cp">&lt;?php</span>
<span class="k">include</span><span class="p">(</span><span class="s1">&#39;vendor/rmccue/requests/library/Requests.php&#39;</span><span class="p">);</span>
<span class="nx">Requests</span><span class="o">::</span><span class="na">register_autoloader</span><span class="p">();</span>
<span class="nv">$headers</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;Authorization&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Bearer &lt;AccessToken&gt;&#39;</span>
<span class="p">);</span>
<span class="nv">$response</span> <span class="o">=</span> <span class="nx">Requests</span><span class="o">::</span><span class="na">get</span><span class="p">(</span><span class="s1">&#39;http://localhost:6336/api/laptop?sort=&amp;page[number]=1&amp;page[size]=10&#39;</span><span class="p">,</span> <span class="nv">$headers</span><span class="p">);</span>
</pre></div>


<h1 id="filtering">Filtering<a class="headerlink" href="#filtering" title="Permanent link">Link</a></h1>
<p>Used to search items in a table that matche the filter's conditions. Filters follow the syntax <code>query=[{"column": "&lt;column_name&gt;", "operator": "&lt;compare-operator&gt;", "value":"&lt;value&gt;"}]</code></p>
<table>
<thead>
<tr>
<th>Daptin operator</th>
<th>SQL compare operator</th>
</tr>
</thead>
<tbody>
<tr>
<td>contains</td>
<td>like  '%\<value>'</td>
</tr>
<tr>
<td>not contains</td>
<td>not like  '%\<value>'</td>
</tr>
<tr>
<td>is</td>
<td>=</td>
</tr>
<tr>
<td>is not</td>
<td>!=</td>
</tr>
<tr>
<td>before</td>
<td>&lt;</td>
</tr>
<tr>
<td>less then</td>
<td>&lt;</td>
</tr>
<tr>
<td>after</td>
<td>&gt;</td>
</tr>
<tr>
<td>more then</td>
<td>&gt;</td>
</tr>
<tr>
<td>any of</td>
<td>in</td>
</tr>
<tr>
<td>none of</td>
<td>not in</td>
</tr>
<tr>
<td>is empty</td>
<td>is null</td>
</tr>
<tr>
<td>is not empty</td>
<td>is not null</td>
</tr>
</tbody>
</table>
<h2 id="example">Example<a class="headerlink" href="#example" title="Permanent link">Link</a></h2>
<div class="codehilite"><pre><span></span>curl &#39;/api/world?query=[{&quot;column&quot;: &quot;is_hidden&quot;, &quot;operator&quot;: &quot;any of&quot;, &quot;value&quot;:&quot;1,0&quot;}] \
  -H &#39;Authorization: Bearer &lt;AccessToken&gt;&#39;
</pre></div>
              
            </div>
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="../create/" class="btn btn-neutral float-right" title="Create">Next <span class="icon icon-circle-arrow-right"></span></a>
      
      
        <a href="../overview/" class="btn btn-neutral" title="Overview"><span class="icon icon-circle-arrow-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <!-- Copyright etc -->
    
  </div>

  Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
      
        </div>
      </div>

    </section>

  </div>

  <div class="rst-versions" role="note" style="cursor: pointer">
    <span class="rst-current-version" data-toggle="rst-current-version">
      
      
        <span><a href="../overview/" style="color: #fcfcfc;">&laquo; Previous</a></span>
      
      
        <span style="margin-left: 15px"><a href="../create/" style="color: #fcfcfc">Next &raquo;</a></span>
      
    </span>
</div>
    <script>var base_url = '../..';</script>
    <script src="../../js/theme.js" defer></script>
      <script src="../../search/main.js" defer></script>

</body>
</html>
